import { request } from "@/utils/request.js";

// TODO: 登录
export function toLogin(query) {
  return request.get("/user/toLogin", query);
}

// TODO: 判断是否注册
export function isRegister(query) {
  return request.get("/user/isRegister", query);
}

// TODO: 获取全部用户
export function getAllUser() {
  return request.get("/user");
}

// TODO: 根据id查询用户
export function getUserById(query) {
  return request.get("/user/getUserById", query);
}

// TODO: 根据用户名查询用户
export function getUserByName(query) {
  return request.get("/user/getUserByName", query);
}

// TODO: 新增用户
export function addUser(query) {
  return request.post("/user", query);
}

// TODO: 修改用户
export function updateUser(query) {
  return request.put("/user", query);
}

// TODO: 删除用户
export function deleteUser(query) {
  return request.delete("/user", query);
}
